The border
property adds a border around the view using the specified style
and optional width
. This allows you to visually outline views with solid colors, gradients, or system materials, and support light/dark mode adaptations.
style
: Required. Defines the visual appearance of the border. Accepts ShapeStyle
or DynamicShapeStyle
.width
: Optional. Specifies the thickness of the border in pixels. Defaults to 1
.ShapeStyle
, including material blur styles like "regularMaterial"
or "ultraThinMaterial"
for a more iOS-native look.